# from selenium import webdriver
# from selenium.webdriver.common.by import By
# import time
# driver = webdriver.Edge()
# driver.get('file:///D:/gao12212a/alert.html')
# driver.find_element(By.ID,'button').click()
# time.sleep(2)
# alert = driver.switch_to.alert
# alert.accept()
# time.sleep(10)






from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Firefox()
driver.get('file:///D:/gao12212a/login.html')
driver.switch_to.frame(driver.find_element(By.ID,'register'))
driver.find_element(By.ID,'account').send_keys('admin')
driver.find_element(By.ID,'pwd').send_keys('123456')
driver.find_element(By.ID,'pwd_').send_keys('123456')
driver.find_element(By.ID,'prompt').click()
time.sleep(2)
alear =driver.switch_to.alert
alear.send_keys('好好')
time.sleep(2)
alear.accept()
driver.switch_to.default_content()

time.sleep(2)

driver.find_element(By.NAME,'fname').send_keys('admin')
driver.find_element(By.NAME,'fpwd').send_keys('123456')
driver.find_element(By.XPATH,'/html/body/form/input[3]').click()
aleat = driver.switch_to.alert
time.sleep(2)
aleat.accept()
time.sleep(5)
driver.quit()










